/*
 * Copyright (C) 2010-2011 Comcast Cable.  All Rights Reserved.
 */
package com.hercules.android.receiver.handlers.commands;

/**
 * This exception is raised by XRENewCommandHandler/XRESetCommandHandler if it encounters any unsupported command
 * parameter.
 * <p>
 * Note the exception will only be propagated to XREAggregateCommandHandler and then processed by
 * XRECommandErrorHandler. It extends XREObjectCommandHandlerException.
 * <p>
 * <b>Thread Safety:</b> This class is not thread safe as its base class is not thread safe.
 *
 * @author liuliquan, 7realm
 * @version 1.0
 */
public class UnsupportedXRECommandParameterException extends XREObjectCommandHandlerException {
    /** Serial version UID. */
    private static final long serialVersionUID = 2171911125042533219L;
    /**
     * The unsupported command parameter.
     * <p>
     * Initialized in constructor and will not change after. Can be any value. It has a getter.
     */
    private final String unsupportedParameter;

    /**
     * Creates a new instance of UnsupportedXRECommandParameterException with given error message and unsupported
     * command parameter.
     *
     * @param message the error message
     * @param unsupportedParameter the unsupported command parameter
     */
    public UnsupportedXRECommandParameterException(String message, String unsupportedParameter) {
        super(message);
        this.unsupportedParameter = unsupportedParameter;
    }

    /**
     * Creates a new instance of UnsupportedXRECommandParameterException with given error message, the cause and the
     * unsupported command parameter.
     *
     * @param message the error message
     * @param cause the cause of the exception
     * @param unsupportedParameter the unsupported command parameter
     */
    public UnsupportedXRECommandParameterException(String message, Throwable cause, String unsupportedParameter) {
        super(message, cause);
        this.unsupportedParameter = unsupportedParameter;
    }

    /**
     * Gets the unsupported command parameter.
     *
     * @return the unsupported command parameter
     */
    public String getUnsupportedParameter() {
        return unsupportedParameter;
    }
}